<?php

namespace App\Models\Member;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class MemberMoney extends Model
{

    /* 计算 赠送金/余额 总金额 */
    public function getMemberTotalMoney($type)
    {
        $res = $res = DB::table('member as m')
            ->leftJoin('member_extend as me','me.member_id','=','m.id')
            ->where("m.mall_id", request()->mallData["id"])
            ->sum("me.".$type);
        return $res;
    }
}
